package mx.itesm.wakapanda;

import org.cocos2d.sound.SoundEngine;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.FrameLayout;
import android.widget.ImageView;

public class PreMenu extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
		
		setContentView(R.layout.pre_menu);
		
		//ACTIVAR ANIMACION
		
		FrameLayout fondo = (FrameLayout)findViewById(R.id.FondoPreMenu);
		AnimationDrawable animacion = (AnimationDrawable)fondo.getBackground();
		animacion.start();
		
		ImageView tapToStart = (ImageView)findViewById(R.id.tapToStart);
		AnimationDrawable animacion2 = (AnimationDrawable)tapToStart.getBackground();
		animacion2.start();
	
		Context contexto = this;
		SoundEngine.sharedEngine().preloadEffect(contexto,R.raw.main_soundscape);
		SoundEngine.sharedEngine().playSound(contexto, R.raw.main_soundscape,
				true);
				

	}
	


	
public void comenzar (View v){
		
		Intent intencion = new Intent(this, MainMenu.class);
		startActivity(intencion);
		this.finish();
		
	}
	

@Override
public void onBackPressed() {
	super.onBackPressed();
	this.finish();
	
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
	// Inflate the menu; this adds items to the action bar if it is present.
	getMenuInflater().inflate(R.menu.main_menu, menu);
	return true;
}

}
